package Demo_0401.lianxi;

import Demo_0401.SqListClass;

/**
 * @author:zhengyilong
 * @email:1797344574@qq.com
 * @phone:13479394730
 * @desc:
 * @DateTime:2022/4/8 9:50
 **/
public class Demo2 {
    public static void main(String[] args) {
        //数据逆置：{1,2,3,4,5}-->{5,4,3,2,1}
        Integer [] arr = {1,2,3,4,5};
        SqListClass<Integer> list = new SqListClass<>();
        list.CreateList(arr);
        SqListClass<Integer> listSum = new SqListClass<>();
        for (int i=list.size()-1;i>=0;i--){
            listSum.Add(list.GetElem(i));
        }
        for (int i = list.size()-1;i>=0;i--){
            list.Delete(i);
        }
        for (int i=0;i<listSum.size();i++){
            list.Add(listSum.GetElem(i));
        }
        System.out.println(list);

    }
}

